finding equivalent resistance